home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / Dir / dir.g2 < prev    next >
Text File  |  1999-04-21  |  2KB  |  124 lines

  1. G4C
  2.  
  3. ;  helper gui for dealing with files
  4.  
  5. ;  THE POP-UP ON DOUBLE-CLICK GUIs
  6.  
  7.  
  8. WinBig 0 0 80 90 ""
  9. WinType 00001000
  10. winonmouse 30 7 
  11. varpath dir.gc/cli.gc    ; the guis whose vars we need
  12.  
  13. xOnRMB 
  14. guiclose Dir.g2
  15.  
  16. xOnInactive
  17. guiclose Dir.g2
  18.  
  19. xOnFail
  20. ezreq "Error during operation" OK ""
  21.  
  22. ;---------------> the Buttons
  23.  
  24. xbutton 0 0 0 15 Auto
  25. guiclose dir.g2
  26. ; using the new routines
  27. guiload guis:tools/rtn/GetFileType $dir.gc/lv_file
  28. filetype = $$ret.0
  29. if $filetype > ''
  30.     guiload guis:tools/rtn/ViewFile $dir.gc/lv_file $dir.g2/filetype RUN
  31. endif
  32.  
  33. xbutton 0 15 0 15 More..
  34. guiopen dir.pop2
  35. guiclose dir.g2
  36.  
  37. xbutton 0 30 0 15 List
  38. *FILENAME = $lv_file
  39. guiload guis:tools/read.gc
  40. guiopen read.gc
  41.  
  42. xbutton 0 45 0 15 Cli..        ; call the cli.gc gui with FileName & Mode
  43. cd $$lv.dir
  44. guiclose dir.g2
  45. guiload guis:tools/cli.gc $dir.gc/lv_file RUN
  46.  
  47. xbutton 0 60 0 15 'Edit'
  48. ifexists port rexx_ced        ; if the CygnusEd editor is running..
  49.    ifexists gui cedbar.gc    ; use it for the editing
  50.        guiscreen cedbar.gc front
  51.    else
  52.        guiscreen dir.g2 back    ; hoping that Ced is the next screen..
  53.    endif
  54.    sendrexx rexx_ced 'open new'
  55.    sendrexx rexx_ced 'open $lv_file'
  56.    sendrexx rexx_ced 'expand view'
  57. else
  58.    run '$*DEF.EDITOR $lv_file'
  59. endif
  60. guiclose dir.g2
  61.  
  62. xbutton 0 75 0 15 Rx
  63. guiclose dir.g2
  64. extract lv_file path path
  65. cd '$path'
  66. cli 'rx $lv_file'
  67.  
  68.  
  69. ;#########################################################################
  70.  
  71. NEWFILE dir.pop2    ; Pop-up on double-click "More.." gui.
  72.  
  73. WinBig 0 0 80 90 ""
  74. WinType 00001000
  75. winonmouse 30 7 
  76. varpath dir.gc/cli.gc/dir.search    ; the guis whose vars we need
  77.  
  78. xOnRMB
  79. guiclose Dir.pop2
  80.  
  81. xOnInactive
  82. guiclose Dir.pop2
  83.  
  84. xOnFail
  85. ezreq "Error during operation" OK ""
  86.  
  87. ;---------------> the Buttons
  88.  
  89. xbutton 0 0 0 15 'MView'
  90. guiclose dir.pop2
  91. run '$*DEF.DT $lv_file'
  92.  
  93. xbutton 0 15 0 15 'FRead'
  94. guiclose dir.pop2
  95. *FRGUIDE = $lv_file
  96. guiload guis:tools/fastread/fastread.gc
  97.  
  98. xbutton 0 30 0 15 'DPaint'
  99. ifexists port DPAINT.1
  100.    .trx = '/* */\nADDRESS "DPAINT.1"\nLOADANIM '
  101.    appvar .trx "\'FILE=$lv_file\'"
  102.    sendrexx REXX env:.trx
  103.    guiscreen dir.pop2 back
  104. elseifexists file c:wbrun
  105.    run 'c:wbrun $*DEF.PAINT $lv_file'
  106. else
  107.    run '$*DEF.PAINT $lv_file'
  108. endif
  109. guiclose dir.pop2
  110.  
  111. xbutton 0 45 0 15 'GfxEd'
  112. run '$*DEF.GFXED $lv_file'
  113.  
  114. xbutton 0 60 0 15 'HexView'
  115. run '$*DEF.HEX $lv_file'
  116.  
  117. xbutton 0 75 0 15 'Mod'
  118. run '$*DEF.MOD $dir.gc/lv_file'
  119.  
  120.  
  121.  
  122.  
  123.  
  124.